package utils;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;

/**
 * Created by iss on 17/10/17.
 */
public class FileReader3 {

    public static void main(String[] args) throws IOException {

        File file = new File("/Users/iss/guangzhou.txt");
        java.io.FileReader fr = new java.io.FileReader(file);

        BufferedReader br = new BufferedReader(fr);

        String str = br.readLine();
        StringBuilder sb = new StringBuilder("");
        int count = 0;

        while (str != null) {
            try {
                str = str.substring(str.indexOf(")") + 2, str.length() - 1);
                if (str.length() == 11) {
                    count++;
                    sb.append(str).append(",");
                }
            } catch (Exception e) {
                e.printStackTrace();
            }

            str = br.readLine();
        }

        br.close();
        fr.close();

        System.out.println("total = " + count);
        System.out.println("used = " + sb);
    }

}
